import siteInfo from '../siteinfo.js'
const url = function(action, querystring) {
	var url = siteInfo.siteroot + '?i=' + siteInfo.uniacid + '&t=' + siteInfo.multiid + '&v=' + siteInfo.version +
		'&from=wxapp&';
	if (action) {
		action = action.split('/');
		if (action[0]) {
			url += 'c=entry&';
			url += 'a=weapp&';
			url += 'm=jw_ys&';
		}
		if (action[1]) {
			url += 'do=' + action[1] + '&';
		}
		if (action[2]) {
			url += 'action=' + action[2];
		}
	}
	if (querystring && typeof querystring === 'object') {
		for (let param in querystring) {
			if (param && querystring.hasOwnProperty(params) && querystring[param]) {
				url += param + '=' + querystring[param] + '&';
			}
		}
	}
	return url;
}

const url2 = function(action){
	return "https://benwei.ub-7.com/"+action
	//return "http://localhost:5757/"+action
}

export default url2;
